package br.com.service;

import java.util.List;

import javax.ejb.EJB;
import javax.persistence.EntityManager;

import br.com.dao.GenericDAO;
import br.com.domain.Domain;
import br.com.exception.ServiceException;

@SuppressWarnings({ "rawtypes" })
public abstract class GenericService {		

	
	@EJB 
	public GenericDAO genericDAO;
	
	
	/**************************************************************************/
	/**                                M�TODOS                               **/
	/**************************************************************************/
	
	public abstract Domain salvar(Domain objeto) throws ServiceException;
	public abstract void salvar(List<? extends Domain> listObjeto) throws ServiceException ; 
	public abstract void excluir(Domain objeto) throws ServiceException;
	public abstract void excluir(List<? extends Domain> listObjeto) throws ServiceException;
	public abstract Domain buscarPorId(String nomeClasse, Integer id) throws ServiceException;
	public abstract List<? extends Domain> buscarPorFilter(Domain objeto) throws ServiceException;
	public abstract List<? extends Domain> buscarTodos(String nomeClasse, String... parametros) throws ServiceException;
	public abstract List<? extends Domain> buscarTodos(String nomeClasse, int startPage, int maxPerPage, String... parametros) throws ServiceException;
	public abstract EntityManager getEntityManager() throws ServiceException;
	public abstract Boolean executarQueryExecute(String query, Object... parametros) throws ServiceException;
	public abstract List<? extends Domain> executarQueryList(String query, Object... parametros) throws ServiceException;
	public abstract Domain executarQuerySingle(String query, Object... parametros) throws ServiceException;
	public abstract List<? extends Domain> executarQuerySqlList(String sql, String nomeClasse) throws ServiceException; 
	public abstract Domain executarQuerySqlSingle(String sql, String nomeClasse) throws ServiceException;
	public abstract Domain buscarUltimoRegistro(String nomeClasse) throws ServiceException;
    /**  *********************************************************************/
	
	
}
